package com.bieyang.anjia.ui.adapter;

import java.util.List;

import com.bieyang.anjia.R;
import com.bieyang.anjia.module.Deviceinfo;
import com.bieyang.anjia.module.HelpInfo;
import android.app.ProgressDialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class HelpAdapter extends BaseAdapter {
	private LayoutInflater inflater;
	View view;
	public TextView txtPlay, txtResetName, txtSetZhuji, txtRemove, txtjilu;
	int currentPosition;
	public ProgressDialog progressDialog;
	 
	public String imsi;
	Context con;
	List<HelpInfo> helpList;
	Deviceinfo devInfo;
	String uuid;

	public HelpAdapter(Context con) {
		this.con = con;
		inflater = LayoutInflater.from(con);
	}

	public HelpAdapter(Context con, List<HelpInfo> helpList) {
		this.helpList = helpList;
		this.con = con;
		inflater = LayoutInflater.from(con);

	}

	public List<HelpInfo> getNewsList() {
		return helpList;
	}

	public void setNewsList(List<HelpInfo> newsList) {
		this.helpList = newsList;
		notifyDataSetChanged();
	}

	@Override
	public int getCount() {
		if(helpList==null)
			return 0;
		else
		return helpList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder holder;

		if (convertView == null) {
			holder = new ViewHolder();
			convertView = inflater.inflate(R.layout.help_item, null);


			holder.tvHelpTitle = (TextView) convertView
					.findViewById(R.id.tvHelpTitle);

			
			holder.tvHelpTitle.setText(helpList.get(position).title);


			convertView.setTag(holder);

		} else {
			holder = (ViewHolder) convertView.getTag();
		}

		return convertView;
	}

	public class ViewHolder {
		ImageView imgNews;
		TextView tvHelpTitle;
		TextView  tvTime;
		 
	}

	



}
